from django.utils.deprecation import MiddlewareMixin
from z_Userapp.models import JurisdictionModel

# 中间件
class Middle(MiddlewareMixin):
    def process_request(self,request):
        # 获取uid
        uid=request.GET.get('uid',None)
        # 如果存在，则查询
        if uid:
            # user=JurisdictionModel.objects.filter(user_id=uid)
            request.level=int(uid) & 1

